<template>
  <el-table v-loading="loading" :data="infoList">
    <el-table-column type="index" width="55" align="center" label="序号" />
    <el-table-column label="护士名称" align="center" prop="nurseName" />
    <el-table-column
      label="执业证编号"
      align="center"
      prop="certificateNumber"
    />
    <el-table-column label="身份证号" align="center" prop="identityNumber" />
    <el-table-column label="提醒类型" align="center" prop="expiredType" />
    <el-table-column
      label="操作"
      align="center"
      class-name="small-padding fixed-width"
    >
      <template slot-scope="scope">
        <el-button size="mini" type="text" @click="handleInfo(scope.row)"
          >更新状态</el-button
        >
      </template>
    </el-table-column>
  </el-table>

  <!--<pagination
    v-show="total>0"
    :total="total"
    :page.sync="queryParams.pageNum"
    :limit.sync="queryParams.pageSize"
    @pagination="getList"
  />
--></template>

<script>
import { nurse, nurseUpdateExpireDate } from "@/api/zhangping/zpMedicalTodo";
export default {
  name: "hsglTable",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 一企一档表格数据
      infoList: [],
      // 查询参数
      queryParams: {},
      // 表单参数
    };
  },
  /*props: {
    editVisible: {
      type: Boolean,
      default: () => {
        return false
      }
    }
  },
  watch:{

  },
  computed: {
    show: {
      get () {
        return this.editVisible
      },
      set (val) {
        this.$emit('update:editVisible', val)
      }
    },
  },*/
  created() {
    this.getList();
  },
  methods: {
    getList() {
      this.loading = true;
      nurse().then((resp) => {
        this.infoList = resp.data;
        this.loading = false;
      });
    },
    handleInfo(row) {
      this.$modal
        .confirm("是否确认更新状态？")
        .then(function () {
          return nurseUpdateExpireDate(row.id);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("更新成功");
        })
        .catch(() => {});
    },
  },
};
</script>

<style></style>
